import request from '@/utils/request'

// 查询代理商信息列表
export function listAgent(query) {
    return request({
        url: '/business/agent/list',
        method: 'get',
        params: query
    })
}

// 查询代理商信息详细
export function getAgent(id) {
    return request({
        url: '/business/agent/' + id,
        method: 'get'
    })
}

// 新增代理商信息
export function addAgent(data) {
    return request({
        url: '/business/agent',
        method: 'post',
        data: data
    })
}

// 修改代理商信息
export function updateAgent(data) {
    return request({
        url: '/business/agent',
        method: 'put',
        data: data
    })
}

// 删除代理商信息
export function delAgent(id) {
    return request({
        url: '/business/agent/' + id,
        method: 'delete'
    })
}

// 行政区划组织
export function getAreaTree(pcode) {
    return request({
        url: '/system/areaCode/list?pcode=' + pcode,
        method: 'get'
    })
}
